package jiang.jredis.starter;

import jiang.jredis.channel.ChannelScanBeanDefinitionRegistryPostProcessor;
import jiang.jredis.starter.annotation.EnableChannel;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Redis发布订阅相关配置
 * 配置Channel扫描注册器的后置处理器
 */
@Configuration
@ConditionalOnBean(annotation = EnableChannel.class)
public class RedisChannelAutoConfiguration {

    /**
     * 配置Channel扫描注册的后置处理器
     */
    @Bean
    public static ChannelScanBeanDefinitionRegistryPostProcessor channelScanBeanDefinitionRegistryPostProcessor() {
        return new ChannelScanBeanDefinitionRegistryPostProcessor();
    }

}
